<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新品有戏后台管理</title>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <style>
        tr td{
            text-align: center;
            vertical-align: middle!important;
        }
    </style>
</head>
<body>
{include file="base/header"}
<div style="float: right; margin-top: 5px;margin-bottom: 5px" class="box-title " >
    <form class="form-inline" action="{:url('online/mail/order')}" method="get">
        <input type="hidden" name="bid" value="{$bid}" />
        <input type="text" name="title" value="<?php if(isset($title)) echo $title ?>" placeholder="订单号，联系人，联系电话" class="form-control" id="exampleInputEmail3" >
        <input type="submit" class="btn btn-default" value="搜索"/>
        <input type="button" onclick="res({$bid})" value="全部显示" class="btn btn-default"/>
    </form>
</div>
<table class="layui-table">
    <thead>
    <tr>
        <td>订单号</td>
        <td>联系人</td>
        <td>联系电话</td>
        <td>总计(元)</td>
        <td>支付凭证</td>
        <td>邮寄地址</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {foreach $result as $val}
    <tr>
        <td>{$val.ordernumber}</td>
        <td>{$val.linkman}</td>
        <td>{$val.telephone}</td>
        <td>{$val.total}</td>
        <td onclick="enlarge({$val.id})"><img src="__ROOT__\\{$val.prove}" height="50px" width="50px"></td>
        <td>{$val.province}{$val.city}{$val.county}{$val.town}{$val.address}</td>
        <td>
            <button  onclick="detail({$val.ordernumber})" type="button" class="btn btn-primary btn-xs">详情</button>
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>
{$result->render()}
</body>
<script>
    //支付凭证
    function enlarge(id) {
        layer.open({
            type:2,
            title:"支付凭证",
            area: ['500px', '500px'],
            anim:2,
            content:"{:url('online/mail/enlarge')}?id="+id
        });
    }
    //订单详情
    function detail(ordernumber) {
        window.location.href = "{:url('online/mail/detail')}?ordernumber="+ordernumber;
    }
    //全部显示
    function res(bid) {
        window.location.href = "{:url('online/mail/order')}?bid="+bid;
    }
</script>
</html>